package cn.nexd.app.indoor.presenter;

import android.content.Context;
import android.content.SharedPreferences;

import cn.nexd.app.indoor.ui.iView.ILoadingActivityView;
import cn.nexd.app.indoor.util.SharedPreferencesUtil;

/**
 * Created by wangxu on 16/7/19.
 */
public class LoadingPresenter extends BasePresenter<ILoadingActivityView> {

    SharedPreferences spIsFirstInstall;

    public LoadingPresenter(Context context, ILoadingActivityView iView) {
        super(context, iView);
    }

    public void startAnim() {
        spIsFirstInstall = SharedPreferencesUtil.isFirstInstall(context);
        boolean isFirst = spIsFirstInstall.getBoolean("isFirst", false);
        if (!isFirst) {
            SharedPreferences.Editor editor = spIsFirstInstall.edit();
            editor.putBoolean("isFirst", true);
            editor.commit();
            iView.initAnimation();
        } else {
            iView.intoOtherActivity();
        }
    }
}
